home *** CD-ROM | disk | FTP | other *** search
- /** VLTMouse.rexx
- *
- * Example of how to receive mouse move messages from VLT and to
- * extract the line the user clicked on. This macro takes the
- * VLT port name and screen name as arguments.
- *
- **/
- parse arg vltport vltscreen .
- address value vltport
- /*
- * Add libraries if necessary
- */
- if show("l", "rexxarplib.library") = 0 then do
- check = addlib('rexxsupport.library', 0, -30, 0)
- check = addlib('rexxarplib.library', 0, -30, 0)
- end
-
- quitflag = 0
-
- mp = openport(vltport'MOUSE')
-
- do forever
- if quitflag = 1 then leave
- t = waitpkt(vltport'MOUSE')
- do forever
- p = getpkt(vltport'MOUSE')
- if c2d(p) = 0 then leave
-
- string = getarg(p)
- t = reply(p, 0)
-
- parse var string xx yy xold yold xtot ytot qual
-
- "extract x"
- "extract y"
- "movecursor "||xx||" "||yy
- "extract reviewlineatcursor"
- "movecursor "||VLT.x||" "||VLT.y
- str = VLT.reviewlineatcursor
-
- vltwidth = ScreenCols(vltscreen) /* Find size of VLT screen. */
- vltheight = ScreenRows(vltscreen)
- if vltwidth == -1 then do /* If width was -1, it was */
- vltwidth = ScreenCols() /* a Workbench window. */
- vltheight = ScreenRows()
- end
- vltwidth = vltwidth - 48
- vltheight = vltheight - 100
-
- if length(str) * 8 > vltwidth then str = left(str, vltwidth % 8)
-
- str = request(0, vltheight % 4, "Edit and send:",str,,"Cancel", vltscreen)
- if str ~= "" then 'send raw ('||str||')'
- end
- end
-
- /* This example doesn't really ever: */
- exit
-
-